#include<iostream>
using namespace std;
int memo[201][201];
int dfs(int left, int right)
{
    if (left >= right) return 0;
    if (memo[left][right] != 0) return memo[left][right];
    int ret = INT_MAX;
    for (int head = left; head <= right; head++)
    {
        int x = dfs(left, head - 1);
        int y = dfs(head + 1, right);

        ret = min(ret, max(x, y) + head);
    }
    memo[left][right] = ret;
    return ret;
}
int getMoneyAmount(int n) {
    return dfs(1, n);
}
int main()
{


	return 0;
}